import asyncio
from pyppeteer import launch
from pyquery import PyQuery as pq


async def main():
    browser=await launch()  # 新建一个 Browser 对象
    page=await browser.newPage()
    await page.goto('https://dynamic2.scrape.center/')
    await page.waitForSelector('.item .name')
    doc=pq(await page.content())
    names=[item.text() for item in doc('.item .name').items()]
    print('Names:', names)
    await browser.close()


asyncio.get_event_loop().run_until_complete(main())
